<?php

namespace app\admin\validate;

use think\Validate;

class AppValidate extends Validate
{
    // 定义验证规则
    protected $rule = [
        'appid'     => 'require|number',
        'appname'  => 'require',
        'appicon'    => 'require',
        'introduction'    => 'require',
        'author'    => 'require',
        'group'    => 'require',
        'title'    => 'require',
        'content'    => 'require',
        'version'    => 'require',
        'updatecontent'    => 'require',
        'download'    => 'require',
        'zcmoney'    => 'require|number',
        'zcexp'    => 'require|number',
        'zcvip'    => 'require|number',
        'signmoney'    => 'require|number',
        'signexp'    => 'require|number',
        'signvip'    => 'require|number',
        'postmoney'    => 'require|number',
        'postexp'    => 'require|number',
        'commentmoney'    => 'require|number',
        'commentexp'    => 'require|number',
        'hierarchy'    => 'require',
        'app_site_status'    => 'require',
    ];
    //定义验证场景
    protected $scene = [
        'updateapp'  =>  ['appid','appname','appicon','introduction','author','group','title','content','version','updatecontent','download','zcmoney','zcexp','zcvip','signmoney','signexp','signvip','app_site_status','postmoney','postexp','commentmoney','commentexp','hierarchy',],
        'addapp'  =>  ['appname'],
    ];
}